<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Pandas对象的数据操作：增删改查 | Python 数据分析学习目录</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../数据分析库的操作/5Pandas数据操作：其他操作.html" />
    
    
    <link rel="prev" href="../数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="4.4"
        data-chapter-title="Pandas对象的数据操作：增删改查"
        data-filepath="数据分析库的操作/4Pandas对象的数据操作：增删改查.md"
        data-basepath=".."
        data-revision="Wed Oct 24 2018 21:30:49 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        数据分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="Python数据分析序言/内容序言.html">
            
                
                    <a href="../Python数据分析序言/内容序言.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Python数据分析内容
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="python数据分析环境和工具/Python数据分析相关.html">
            
                
                    <a href="../python数据分析环境和工具/Python数据分析相关.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        python数据分析环境和工具
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="python数据分析环境和工具/1Python数据课程软件和环境安装.html">
            
                
                    <a href="../python数据分析环境和工具/1Python数据课程软件和环境安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Python数据课程 软件和环境安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="python数据分析环境和工具/2python发行版.html">
            
                
                    <a href="../python数据分析环境和工具/2python发行版.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        python发行版
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
            
                
                    <a href="../python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        交互式编辑器-JupyterNotebook
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
            
                
                    <a href="../python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        Jupyter-notebook拓展应用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="python数据分析环境和工具/包和环境管理器：conda.html">
            
                
                    <a href="../python数据分析环境和工具/包和环境管理器：conda.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        包和环境管理器：conda
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="python数据分析环境和工具/pip和Virtualenv.html">
            
                
                    <a href="../python数据分析环境和工具/pip和Virtualenv.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.1.</b>
                        
                        pip和Virtualenv
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="python数据分析环境和工具/3Markdown.html">
            
                
                    <a href="../python数据分析环境和工具/3Markdown.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        标记语言：Markdown
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="python数据分析环境和工具/4Markdown语法.html">
            
                
                    <a href="../python数据分析环境和工具/4Markdown语法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.1.</b>
                        
                        Markdown语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5.2" data-path="python数据分析环境和工具/6Gitbook文档.html">
            
                
                    <a href="../python数据分析环境和工具/6Gitbook文档.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.2.</b>
                        
                        文档管理工具-Gitbook
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="数据分析库的初步认识/index.html">
            
                
                    <a href="../数据分析库的初步认识/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        数据分析库-Pandas
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="数据分析库的初步认识/Pandas创建.html">
            
                
                    <a href="../数据分析库的初步认识/Pandas创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        pandas
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="数据分析库的初步认识/Series创建.html">
            
                
                    <a href="../数据分析库的初步认识/Series创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        Series
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="数据分析库的初步认识/DataFrame创建.html">
            
                
                    <a href="../数据分析库的初步认识/DataFrame创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        DataFrame对象-创建
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" >
            
            <span><b>4.</b> 数据分析库的操作</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="数据分析库的操作/1DataFrame查询1-整体.html">
            
                
                    <a href="../数据分析库的操作/1DataFrame查询1-整体.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        DataFrame查询1-整体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="数据分析库的操作/2DataFrame查询2-专用查询.html">
            
                
                    <a href="../数据分析库的操作/2DataFrame查询2-专用查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        DataFrame查询2-专用查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
            
                
                    <a href="../数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        DataFrame查询3-专有查询：过滤查询
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="4.4" data-path="数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
            
                
                    <a href="../数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        Pandas对象的数据操作：增删改查
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="数据分析库的操作/5Pandas数据操作：其他操作.html">
            
                
                    <a href="../数据分析库的操作/5Pandas数据操作：其他操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        Pandas数据操作：其他操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="数据分析库的操作/6Pandas数据存取.html">
            
                
                    <a href="../数据分析库的操作/6Pandas数据存取.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        Pandas数据存取
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="数据分析库的操作/7Pandas数据运算.html">
            
                
                    <a href="../数据分析库的操作/7Pandas数据运算.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        Pandas数据运算
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.3.1" data-path="数据分析库的操作/7.1Pandas数据运算拓展.html">
            
                
                    <a href="../数据分析库的操作/7.1Pandas数据运算拓展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.1.</b>
                        
                        Pandas数据运算-拓展
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.4" data-path="数据分析库的操作/8Pandas分组聚合1.html">
            
                
                    <a href="../数据分析库的操作/8Pandas分组聚合1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.4.</b>
                        
                        Pandas分组聚合1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.5" data-path="数据分析库的操作/9Pandas分组聚合2.html">
            
                
                    <a href="../数据分析库的操作/9Pandas分组聚合2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.5.</b>
                        
                        Pandas分组聚合2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.6" data-path="数据分析库的操作/10Pandas数据规整-清理.html">
            
                
                    <a href="../数据分析库的操作/10Pandas数据规整-清理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.6.</b>
                        
                        Pandas数据规整-清理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.7" data-path="数据分析库的操作/11Pandas数据规整-转换.html">
            
                
                    <a href="../数据分析库的操作/11Pandas数据规整-转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.</b>
                        
                        Pandas数据规整-转换
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.7.1" data-path="数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
            
                
                    <a href="../数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.1.</b>
                        
                        离散化和面元划分
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.8" data-path="数据分析库的操作/16Pandas数据规整-合并.html">
            
                
                    <a href="../数据分析库的操作/16Pandas数据规整-合并.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.8.</b>
                        
                        Pandas数据规整-合并
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
            
                
                    <a href="../数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        Pandas数据规整-重塑和轴向旋转
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.1" data-path="数据分析库的操作/13.1透视表和交叉表.html">
            
                
                    <a href="../数据分析库的操作/13.1透视表和交叉表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.1.</b>
                        
                        透视表和交叉表
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="Python可视化/绘图库-Matplotlib.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Python可视化
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        基础：Matplotlib常见图表
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.1.</b>
                        
                        Matplotlib常见设置和操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        提升：绘图区域
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        提升：绘图组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        拓展：高级绘图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        拓展：数学计算展示图像
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="Python可视化/绘图库-Matplotlib/5注意事项.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/5注意事项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        拓展：注意事项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="Python可视化/绘图库-Matplotlib/6pylab.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/6pylab.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        拓展：pylab
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="数据分析必备知识点/数据分析必备知识点汇集.html">
            
                
                    <a href="../数据分析必备知识点/数据分析必备知识点汇集.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        数据分析必备知识点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7" data-path="数据分析必备知识点/数据分析流程.html">
            
                
                    <a href="../数据分析必备知识点/数据分析流程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        数据分析流程
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Python 数据分析学习目录</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="pandas-&#x5BF9;&#x8C61;&#x7684;&#x6570;&#x636E;&#x64CD;&#x4F5C;&#xFF1A;&#x589E;&#x5220;&#x6539;&#x67E5;">Pandas &#x5BF9;&#x8C61;&#x7684;&#x6570;&#x636E;&#x64CD;&#x4F5C;&#xFF1A;&#x589E;&#x5220;&#x6539;&#x67E5;</h1>
<hr>
<h4 id="&#x6570;&#x636E;&#x64CD;&#x4F5C;">&#x6570;&#x636E;&#x64CD;&#x4F5C;</h4>
<ul>
<li>&#x521B;&#x5EFA;&#xFF1A;C,Create</li>
<li>&#x67E5;&#x8BE2;&#xFF1A;R,Read</li>
<li>&#x589E;&#x52A0;&#xFF1A;I,Insert</li>
<li>&#x4FEE;&#x6539;&#xFF1A;U,Update</li>
<li>&#x5220;&#x9664;&#xFF1A;D,Delete</li>
</ul>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># &#x521B;&#x5EFA;&#x5BF9;&#x8C61;</span>
a_values = [
    [<span class="hljs-string">&apos;&#x5C0F;&#x660E;&apos;</span>,<span class="hljs-string">&apos;male&apos;</span>,<span class="hljs-number">18</span>,<span class="hljs-number">170</span>,<span class="hljs-number">60</span>,<span class="hljs-string">&apos;&#x5317;&#x4EAC;&#x6D77;&#x6DC0;&apos;</span>,<span class="hljs-number">61</span>],
    [<span class="hljs-string">&apos;&#x5C0F;&#x534E;&apos;</span>,<span class="hljs-string">&apos;female&apos;</span>,<span class="hljs-number">28</span>,<span class="hljs-number">160</span>,<span class="hljs-number">50</span>,<span class="hljs-string">&apos;&#x4E0A;&#x6D77;&#x9759;&#x5B89;&apos;</span>,<span class="hljs-number">74</span>],
    [<span class="hljs-string">&apos;&#x5C0F;&#x7EA2;&apos;</span>,<span class="hljs-string">&apos;female&apos;</span>,<span class="hljs-number">22</span>,<span class="hljs-number">175</span>,<span class="hljs-number">64</span>,<span class="hljs-string">&apos;&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;&apos;</span>,<span class="hljs-number">59</span>],
    [<span class="hljs-string">&apos;&#x5C0F;&#x9751;&apos;</span>,<span class="hljs-string">&apos;male&apos;</span>,<span class="hljs-number">31</span>,<span class="hljs-number">182</span>,<span class="hljs-number">80</span>,<span class="hljs-string">&apos;&#x6DF1;&#x5733;&#x5357;&#x5C71;&apos;</span>,<span class="hljs-number">82</span>],
    [<span class="hljs-string">&apos;&#x5C0F;&#x5170;&apos;</span>,<span class="hljs-string">&apos;female&apos;</span>,<span class="hljs-number">25</span>,<span class="hljs-number">165</span>,<span class="hljs-number">55</span>,<span class="hljs-string">&apos;&#x676D;&#x5DDE;&#x897F;&#x6E56;&apos;</span>,<span class="hljs-number">98</span>],
]

a = pd.DataFrame(
    a_values,
    index=[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>],
    columns=[<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;sex&apos;</span>,<span class="hljs-string">&apos;age&apos;</span>,<span class="hljs-string">&apos;heigh&apos;</span>,<span class="hljs-string">&apos;weight&apos;</span>,<span class="hljs-string">&apos;address&apos;</span>,<span class="hljs-string">&apos;grade&apos;</span>]
)
a
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5C0F;&#x660E;</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<h1 id="dadaframe-&#x5BF9;&#x8C61;-&#x7684;&#x4FEE;&#x6539;&#x7684;&#x89C6;&#x56FE;&#x548C;&#x526F;&#x672C;&#x95EE;&#x9898;">DadaFrame &#x5BF9;&#x8C61; &#x7684;&#x4FEE;&#x6539;&#x7684;&#x89C6;&#x56FE;&#x548C;&#x526F;&#x672C;&#x95EE;&#x9898;</h1>
<ul>
<li><p>&#x89C6;&#x56FE;&#x6A21;&#x5F0F;</p>
<ul>
<li>&#x8BB2;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x6574;&#x4F53;&#x8D4B;&#x503C;&#x7ED9;&#x53E6;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;</li>
<li>&#x4FEE;&#x6539;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#xFF0C;&#x53E6;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#x503C;&#x4E5F;&#x4F1A;&#x53D8;</li>
<li>&#x5BF9;&#x4E2A;&#x53D8;&#x91CF;&#x6570;&#x636E;&#x6307;&#x5411;&#x540C;&#x4E00;&#x4E2A;&#x5185;&#x5B58;&#x6570;&#x636E;</li>
</ul>
</li>
<li><p>&#x526F;&#x672C;&#x6A21;&#x5F0F;</p>
<ul>
<li>&#x5C06;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x67E5;&#x8BE2;&#x7684;&#x4E00;&#x90E8;&#x5206;&#x503C;&#x8D4B;&#x503C;&#x7ED9;&#x53E6;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;</li>
<li>&#x4FEE;&#x6539;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#xFF0C;&#x53E6;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#x503C;&#x4E0D;&#x4F1A;&#x53D8;</li>
</ul>
</li>
</ul>
<p> &#x5F53;&#x5C06;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x6574;&#x4F53;&#x8D4B;&#x503C;&#x7ED9;&#x53E6;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#x65F6;&#xFF0C;<strong>&#x89C6;&#x56FE;&#x6A21;&#x5F0F;</strong>&#xFF0C;&#x4E24;&#x4E2A;&#x53D8;&#x91CF;&#x5BF9;&#x5E94;&#x7684;&#x5185;&#x5B58;&#x5730;&#x5740;&#x76F8;&#x540C;&#xFF0C;&#x4FEE;&#x6539;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#xFF0C;&#x53E6;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#x4E5F;&#x4F1A;&#x6539;&#x53D8;&#x3002;</p>
<p> &#x6216;&#x8005;&#x4F7F;&#x7528;&#x67E5;&#x8BE2;&#x8D4B;&#x503C;&#xFF0C;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#x7684;&#x4E00;&#x90E8;&#x5206;&#x5E76;&#x8D4B;&#x503C;&#x7ED9;&#x5176;&#x4ED6;&#x53D8;&#x91CF;</p>
<ul>
<li>&#x5F53;&#x8D4B;&#x503C;&#x4E3A;&#x539F;&#x6570;&#x636E;&#x67E5;&#x8BE2;&#x7684;&#x4E00;&#x90E8;&#x5206;&#x65F6;&#xFF0C;&#x662F;<strong>&#x526F;&#x672C;&#x6A21;&#x5F0F;</strong>&#xFF0C;&#x4FEE;&#x6539;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#x4E0D;&#x4F1A;&#x5F71;&#x54CD;&#x53E6;&#x4E00;&#x4E2A; &#x53D8;&#x91CF;</li>
</ul>
<pre><code class="lang-python">a.loc[<span class="hljs-number">1</span>,<span class="hljs-string">&apos;name&apos;</span>]<span class="hljs-comment">#&#x67E5;&#x8BE2;</span>
</code></pre>
<pre><code>&apos;&#x5C0F;&#x660E;&apos;
</code></pre><pre><code class="lang-python">a.loc[<span class="hljs-number">1</span>,<span class="hljs-string">&apos;name&apos;</span>] = <span class="hljs-string">&apos;&#x5C0F;&#x660E;&#x660E;&apos;</span>
a
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5C0F;&#x660E;&#x660E;</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<h4 id="&#x89C6;&#x56FE;&#x6A21;&#x5F0F;">&#x89C6;&#x56FE;&#x6A21;&#x5F0F;</h4>
<pre><code class="lang-python">b = a <span class="hljs-comment">#&#x5C06;a &#x8D4B;&#x503C;&#x7ED9;b</span>
b
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5C0F;&#x660E;&#x660E;</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">b.loc[<span class="hljs-number">1</span>,<span class="hljs-string">&apos;name&apos;</span>]
</code></pre>
<pre><code>&apos;&#x5C0F;&#x660E;&#x660E;&apos;
</code></pre><pre><code class="lang-python">b.loc[<span class="hljs-number">1</span>,<span class="hljs-string">&apos;name&apos;</span>] = <span class="hljs-string">&apos;&#x5927;&#x660E;&#x660E;xxx&apos;</span>
b
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">a
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<h3 id="&#x4F7F;&#x7528;copy&#x51FD;&#x6570;&#x5B9E;&#x73B0;&#x5BF9;&#x8C61;&#x7684;&#x5185;&#x5B58;&#x526F;&#x672C;">&#x4F7F;&#x7528;.copy()&#x51FD;&#x6570;&#x5B9E;&#x73B0;&#x5BF9;&#x8C61;&#x7684;&#x5185;&#x5B58;&#x526F;&#x672C;</h3>
<pre><code class="lang-python">c = a.copy()
c
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">c.loc[<span class="hljs-number">1</span>,<span class="hljs-string">&apos;name&apos;</span>] = <span class="hljs-string">&apos;xxxx&apos;</span> <span class="hljs-comment">#&#x526F;&#x672C;&#x6A21;&#x5F0F;&#xFF0C;&#x5B8C;&#x5168;&#x590D;&#x5236;</span>
c
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>xxxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">a
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<h3 id="&#x526F;&#x672C;&#x6A21;&#x5F0F;">&#x526F;&#x672C;&#x6A21;&#x5F0F;</h3>
<pre><code class="lang-python">c = a.loc[:, [<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;sex&apos;</span>,<span class="hljs-string">&apos;address&apos;</span>]]
c
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>address</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">c.loc[<span class="hljs-number">1</span>,<span class="hljs-string">&apos;name&apos;</span>] = <span class="hljs-string">&apos;&#x5C0F;&#x660E;yyy&apos;</span>
c
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>address</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5C0F;&#x660E;yyy</td>
      <td>male</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">a
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<hr>
<h1 id="series&#x6570;&#x636E;&#x64CD;&#x4F5C;">Series&#x6570;&#x636E;&#x64CD;&#x4F5C;</h1>
<p>&#x521B;&#x5EFA;</p>
<pre><code class="lang-python">d = pd.Series([<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">8</span>,<span class="hljs-number">12</span>,<span class="hljs-number">14</span>])
d
</code></pre>
<pre><code>0     3
1     5
2     8
3    12
4    14
dtype: int64
</code></pre><p>&#x67E5;&#x8BE2;</p>
<pre><code class="lang-python">d[<span class="hljs-number">2</span>] <span class="hljs-comment">#&#x7D22;&#x5F15;&#x67E5;&#x8BE2;</span>
</code></pre>
<pre><code>8
</code></pre><pre><code class="lang-python">d[<span class="hljs-number">1</span>:<span class="hljs-number">3</span>]  <span class="hljs-comment">#&#x5207;&#x7247;&#x67E5;&#x8BE2;</span>
</code></pre>
<pre><code>1    5
2    8
dtype: int64
</code></pre><pre><code class="lang-python"><span class="hljs-comment"># &#x5E03;&#x5C14;&#x67E5;&#x8BE2;</span>
d[d&gt;<span class="hljs-number">10</span>]
</code></pre>
<pre><code>3    12
4    14
dtype: int64
</code></pre><pre><code class="lang-python"><span class="hljs-comment">#&#x67E5;&#x8BE2;&#x7D22;&#x5F15;&#x548C;&#x503C;</span>
d.index
</code></pre>
<pre><code>RangeIndex(start=0, stop=5, step=1)
</code></pre><pre><code class="lang-python">d.values
</code></pre>
<pre><code>array([ 3,  5,  8, 12, 14], dtype=int64)
</code></pre><p>&#x589E;&#x52A0;</p>
<pre><code class="lang-python">d[<span class="hljs-number">5</span>] = <span class="hljs-number">100</span>
d
</code></pre>
<pre><code>0      3
1      5
2      8
3     12
4     14
5    100
dtype: int64
</code></pre><pre><code class="lang-python">d[<span class="hljs-string">&apos;aaa&apos;</span>]=<span class="hljs-string">&apos;bbb&apos;</span>
d
</code></pre>
<pre><code>0        3
1        5
2        8
3       12
4       14
5      100
aaa    bbb
dtype: object
</code></pre><p>&#x4E0D;&#x540C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5F3A;&#x5236;&#x7EDF;&#x4E00;&#x65F6;&#x5019;&#xFF0C;&#x53EA;&#x80FD;&#x4FDD;&#x5B58;&#x4E3A;&#x5360;&#x7528;&#x5185;&#x5B58;&#x6700;&#x5927;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;</p>
<pre><code class="lang-python">[<span class="hljs-keyword">True</span>, <span class="hljs-number">18</span>, <span class="hljs-number">175.1</span>, <span class="hljs-string">&apos;&#x5C0F;&#x660E;&apos;</span>]
</code></pre>
<pre><code>[True, 18, 175.1, &apos;&#x5C0F;&#x660E;&apos;]
</code></pre><p>&#x4FEE;&#x6539;</p>
<pre><code class="lang-python">d[<span class="hljs-number">0</span>] = <span class="hljs-number">30</span>
d
</code></pre>
<pre><code>0       30
1        5
2        8
3       12
4       14
5      100
aaa    bbb
dtype: object
</code></pre><p>&#x5220;&#x9664;</p>
<p>&#x5220;&#x9664;&#x529F;&#x80FD;&#x7B49;&#x540C;&#x4E8E;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#x65F6;&#x8DF3;&#x8FC7;&#x88AB;&#x5220;&#x9664;&#x6570;&#x636E;</p>
<pre><code class="lang-python">d.drop(<span class="hljs-number">0</span>)  <span class="hljs-comment"># &#x5220;&#x9664;&#x89C6;&#x56FE;,&#x6CA1;&#x6709;&#x771F;&#x7684;&#x5220;&#x9664;&#x539F;&#x6570;&#x636E;</span>
</code></pre>
<pre><code>1        5
2        8
3       12
4       14
5      100
aaa    bbb
dtype: object
</code></pre><pre><code class="lang-python">d  <span class="hljs-comment"># &#x539F;&#x6570;&#x636E;&#x4E0D;&#x53D8;</span>
</code></pre>
<pre><code>0       30
1        5
2        8
3       12
4       14
5      100
aaa    bbb
dtype: object
</code></pre><h2 id="dataframe&#x6570;&#x636E;&#x64CD;&#x4F5C;">DataFrame&#x6570;&#x636E;&#x64CD;&#x4F5C;</h2>
<p>&#x521B;&#x5EFA;&#xFF08;&#x7565;&#xFF09;</p>
<pre><code class="lang-python">e = a.copy()  <span class="hljs-comment"># &#x526F;&#x672C;</span>
e
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x67E5;&#x8BE2;</p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x6574;&#x4F53;&#x67E5;&#x8BE2;</span>
e.index
e.columns
e.values

e.info()
e.describe()
e.head()
e.tail(<span class="hljs-number">3</span>)
</code></pre>
<pre><code>&lt;class &apos;pandas.core.frame.DataFrame&apos;&gt;
Int64Index: 5 entries, 1 to 5
Data columns (total 7 columns):
name       5 non-null object
sex        5 non-null object
age        5 non-null int64
heigh      5 non-null int64
weight     5 non-null int64
address    5 non-null object
grade      5 non-null int64
dtypes: int64(4), object(3)
memory usage: 320.0+ bytes
</code></pre><div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">e.loc[[<span class="hljs-number">3</span>, <span class="hljs-number">5</span>], [<span class="hljs-string">&apos;name&apos;</span>, <span class="hljs-string">&apos;address&apos;</span>]]  <span class="hljs-comment"># &#x7D22;&#x5F15;&#x67E5;&#x8BE2;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>address</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">e.loc[<span class="hljs-number">3</span>:<span class="hljs-number">5</span>, <span class="hljs-string">&apos;name&apos;</span>:<span class="hljs-string">&apos;address&apos;</span>]  <span class="hljs-comment"># &#x5207;&#x7247;&#x67E5;&#x8BE2;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">e.loc[e[<span class="hljs-string">&apos;grade&apos;</span>] &gt; <span class="hljs-number">60</span>, [<span class="hljs-string">&apos;name&apos;</span>, <span class="hljs-string">&apos;age&apos;</span>, <span class="hljs-string">&apos;weight&apos;</span>, <span class="hljs-string">&apos;grade&apos;</span>]]  <span class="hljs-comment"># &#x884C;&#xFF0C;&#x5E03;&#x5C14;&#x67E5;&#x8BE2;&#xFF1B;&#x5217;&#xFF0C;&#x7D22;&#x5F15;&#x67E5;&#x8BE2;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>age</th>
      <th>weight</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>18</td>
      <td>60</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>28</td>
      <td>50</td>
      <td>74</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>31</td>
      <td>80</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>25</td>
      <td>55</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x589E;&#x52A0;</p>
<pre><code class="lang-python">a
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x589E;&#x52A0;&#x884C;&#x3001;&#x5217;&#x7684;&#x4EE3;&#x7801;&#x4E0D;&#x80FD;&#x53CD;&#x590D;&#x6267;&#x884C;&#xFF0C;&#x56E0;&#x4E3A;&#x52A0;&#x4E86;&#x540E;&#x8868;&#x683C;&#x884C;&#x5217;&#x957F;&#x5EA6;&#x4F1A;&#x53D8;</p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x589E;&#x52A0;&#x884C;</span>
e.loc[<span class="hljs-string">&apos;6&apos;</span>] = <span class="hljs-number">0</span>
e
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
      <th>phone</th>
      <th>qq</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170.0</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
      <td>818414</td>
      <td>111</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160.0</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
      <td>818414</td>
      <td>22</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175.0</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
      <td>818414</td>
      <td>333</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182.0</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
      <td>818414</td>
      <td>444</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165.0</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
      <td>818414</td>
      <td>555</td>
    </tr>
    <tr>
      <th>xxx</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0.0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>818414</td>
      <td>666</td>
    </tr>
    <tr>
      <th>yyy</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>female</td>
      <td>35</td>
      <td>155.5</td>
      <td>60</td>
      <td>&#x52A0;&#x5DDE;&#x7845;&#x8C37;</td>
      <td>100</td>
      <td>818414</td>
      <td>888888</td>
    </tr>
    <tr>
      <th>6</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0.0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">e.loc[<span class="hljs-string">&apos;7&apos;</span>] = [<span class="hljs-string">&apos;&#x5F20;&#x4E09;&apos;</span>, <span class="hljs-string">&apos;female&apos;</span>, <span class="hljs-number">35</span>, <span class="hljs-number">155.5</span>, <span class="hljs-number">60</span>, <span class="hljs-string">&apos;&#x52A0;&#x5DDE;&#x7845;&#x8C37;&apos;</span>, <span class="hljs-number">100</span>, <span class="hljs-number">818414</span>,<span class="hljs-number">6666</span>]
e
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
      <th>phone</th>
      <th>qq</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170.0</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
      <td>818414</td>
      <td>111</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160.0</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
      <td>818414</td>
      <td>22</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175.0</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
      <td>818414</td>
      <td>333</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182.0</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
      <td>818414</td>
      <td>444</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165.0</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
      <td>818414</td>
      <td>555</td>
    </tr>
    <tr>
      <th>xxx</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0.0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>818414</td>
      <td>666</td>
    </tr>
    <tr>
      <th>yyy</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>female</td>
      <td>35</td>
      <td>155.5</td>
      <td>60</td>
      <td>&#x52A0;&#x5DDE;&#x7845;&#x8C37;</td>
      <td>100</td>
      <td>818414</td>
      <td>888888</td>
    </tr>
    <tr>
      <th>6</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0.0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
    </tr>
    <tr>
      <th>7</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>female</td>
      <td>35</td>
      <td>155.5</td>
      <td>60</td>
      <td>&#x52A0;&#x5DDE;&#x7845;&#x8C37;</td>
      <td>100</td>
      <td>818414</td>
      <td>6666</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># &#x589E;&#x52A0;&#x5217;</span>
e[<span class="hljs-string">&apos;phone&apos;</span>] = <span class="hljs-number">818414</span>
e
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
      <th>phone</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170.0</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
      <td>818414</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160.0</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
      <td>818414</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175.0</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
      <td>818414</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182.0</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
      <td>818414</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165.0</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
      <td>818414</td>
    </tr>
    <tr>
      <th>xxx</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0.0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>818414</td>
    </tr>
    <tr>
      <th>yyy</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>female</td>
      <td>35</td>
      <td>155.5</td>
      <td>60</td>
      <td>&#x52A0;&#x5DDE;&#x7845;&#x8C37;</td>
      <td>100</td>
      <td>818414</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">e[<span class="hljs-string">&apos;qq&apos;</span>] = [<span class="hljs-number">111</span>,<span class="hljs-number">22</span>,<span class="hljs-number">333</span>,<span class="hljs-number">444</span>,<span class="hljs-number">555</span>,<span class="hljs-number">666</span>,<span class="hljs-number">888888</span>]
e
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
      <th>phone</th>
      <th>qq</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170.0</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
      <td>818414</td>
      <td>111</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160.0</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
      <td>818414</td>
      <td>22</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175.0</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
      <td>818414</td>
      <td>333</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182.0</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
      <td>818414</td>
      <td>444</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165.0</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
      <td>818414</td>
      <td>555</td>
    </tr>
    <tr>
      <th>xxx</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0.0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>818414</td>
      <td>666</td>
    </tr>
    <tr>
      <th>yyy</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>female</td>
      <td>35</td>
      <td>155.5</td>
      <td>60</td>
      <td>&#x52A0;&#x5DDE;&#x7845;&#x8C37;</td>
      <td>100</td>
      <td>818414</td>
      <td>888888</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x4FEE;&#x6539;</p>
<pre><code class="lang-python">f = a.copy()
f
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">f.loc[[<span class="hljs-number">1</span>,<span class="hljs-number">3</span>,<span class="hljs-number">5</span>],[<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;address&apos;</span>]]
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>address</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x5927;&#x660E;&#x660E;xxx</td>
      <td>&#x5317;&#x4EAC;&#x6D77;&#x6DC0;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x5C0F;&#x7EA2;</td>
      <td>&#x5E7F;&#x5DDE;&#x5929;&#x6CB3;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x5C0F;&#x5170;</td>
      <td>&#x676D;&#x5DDE;&#x897F;&#x6E56;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">f.loc[[<span class="hljs-number">1</span>,<span class="hljs-number">3</span>,<span class="hljs-number">5</span>],[<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;address&apos;</span>]] = <span class="hljs-number">0</span>
f
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>0</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>0</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>0</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>0</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>0</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>0</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">f.loc[[<span class="hljs-number">1</span>,<span class="hljs-number">3</span>,<span class="hljs-number">5</span>],[<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;address&apos;</span>]]
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>address</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>0</td>
      <td>0</td>
    </tr>
    <tr>
      <th>3</th>
      <td>0</td>
      <td>0</td>
    </tr>
    <tr>
      <th>5</th>
      <td>0</td>
      <td>0</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">pd.DataFrame([[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>],[<span class="hljs-number">3</span>,<span class="hljs-number">4</span>],[<span class="hljs-number">5</span>,<span class="hljs-number">6</span>]])
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>0</th>
      <th>1</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>1</td>
      <td>2</td>
    </tr>
    <tr>
      <th>1</th>
      <td>3</td>
      <td>4</td>
    </tr>
    <tr>
      <th>2</th>
      <td>5</td>
      <td>6</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># f.loc[[1,3,5],[&apos;name&apos;,&apos;address&apos;]] = [[1,2,3],[4,5]]  # &#x9519;&#x8BEF;&#x4FEE;&#x6539;&#xFF0C;&#x503C;&#x5E94;&#x8BE5;&#x548C;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#x5F62;&#x72B6;&#x76F8;&#x540C;</span>
f.loc[[<span class="hljs-number">1</span>,<span class="hljs-number">3</span>,<span class="hljs-number">5</span>],[<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;address&apos;</span>]] = [[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>],[<span class="hljs-number">3</span>,<span class="hljs-number">4</span>],[<span class="hljs-number">5</span>,<span class="hljs-number">6</span>]]  <span class="hljs-comment"># 3&#x884C;&#x4E24;&#x5217;</span>
f
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>1</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>2</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>3</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>4</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>5</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>6</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x5220;&#x9664;</p>
<ul>
<li>&#x5220;&#x9664;&#x57FA;&#x672C;&#x7B49;&#x540C;&#x4E8E;&#x7B80;&#x5355;&#x7248;&#x7684;&#x67E5;&#x8BE2;</li>
<li>&#x9ED8;&#x8BA4;&#x4E0D;&#x4FEE;&#x6539;&#x539F;&#x503C;&#xFF0C;&#x503C;&#x8F93;&#x51FA;&#x5220;&#x9664;&#x540E;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x771F;&#x5220;&#x9664;&#x52A0;&#x53C2;&#x6570;</li>
</ul>
<p>inplace = True</p>
<ul>
<li>&#x9ED8;&#x8BA4;&#x7684;&#x53C2;&#x6570;&#xFF1A; axis = 0 &#x5220;&#x9664;&#x884C;&#xFF0C;&#x6539;&#x4E3A; axis = 1 &#x5220;&#x9664;&#x5217;</li>
</ul>
<pre><code class="lang-python"><span class="hljs-comment"># &#x5220;&#x9664;&#x884C;</span>
f.drop(<span class="hljs-number">2</span>)  <span class="hljs-comment"># &#x5047;&#x5220;&#x9664;</span>
f.drop(<span class="hljs-number">2</span>, axis=<span class="hljs-number">0</span>)  <span class="hljs-comment"># &#x5B8C;&#x6574;&#x5199;&#x6CD5;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>1</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>2</td>
      <td>61</td>
    </tr>
    <tr>
      <th>3</th>
      <td>3</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>4</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>5</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>6</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">f  <span class="hljs-comment"># &#x539F;&#x503C;&#x4E0D;&#x53D8;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>1</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>2</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>3</th>
      <td>3</td>
      <td>female</td>
      <td>22</td>
      <td>175</td>
      <td>64</td>
      <td>4</td>
      <td>59</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>5</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>6</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># &#x771F;&#x5220;</span>
f.drop(<span class="hljs-number">3</span>, inplace=<span class="hljs-keyword">True</span>)  <span class="hljs-comment"># &#x5220;&#x9664;&#x539F;&#x503C;</span>
</code></pre>
<pre><code class="lang-python">f
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>weight</th>
      <th>address</th>
      <th>grade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>1</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>60</td>
      <td>2</td>
      <td>61</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>50</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
      <td>74</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>80</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
      <td>82</td>
    </tr>
    <tr>
      <th>5</th>
      <td>5</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>55</td>
      <td>6</td>
      <td>98</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># &#x5220;&#x9664;&#x5217;</span>
f.drop([<span class="hljs-string">&apos;weight&apos;</span>], axis=<span class="hljs-number">1</span>)
f.drop([<span class="hljs-string">&apos;weight&apos;</span>, <span class="hljs-string">&apos;grade&apos;</span>], axis=<span class="hljs-number">1</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>sex</th>
      <th>age</th>
      <th>heigh</th>
      <th>address</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>1</td>
      <td>male</td>
      <td>18</td>
      <td>170</td>
      <td>2</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5C0F;&#x534E;</td>
      <td>female</td>
      <td>28</td>
      <td>160</td>
      <td>&#x4E0A;&#x6D77;&#x9759;&#x5B89;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x5C0F;&#x9751;</td>
      <td>male</td>
      <td>31</td>
      <td>182</td>
      <td>&#x6DF1;&#x5733;&#x5357;&#x5C71;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>5</td>
      <td>female</td>
      <td>25</td>
      <td>165</td>
      <td>6</td>
    </tr>
  </tbody>
</table>
</div>



                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html" class="navigation navigation-prev " aria-label="Previous page: DataFrame查询3-专有查询：过滤查询"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../数据分析库的操作/5Pandas数据操作：其他操作.html" class="navigation navigation-next " aria-label="Next page: Pandas数据操作：其他操作"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
